package cn.zc.examination.service.controller;


import cn.tools.core.base.R;
import cn.zc.examination.entity.Dto.ExaminationClassifyDto;
import cn.zc.examination.service.service.ExaminationClassifyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 * 考试类别 前端控制器
 * </p>
 *
 * @author keno
 * @since 2022-02-22
 */
@Api(tags = "后台创建考试类目接口")
@RestController
@RequestMapping("/examination")
public class ExaminationClassifyController {

    @Resource
    private ExaminationClassifyService examinationClassifyService;

    /**
     * 创建一个考试类别名称
     * @param name
     * @return
     */
    @ApiOperation(value = "创建考试类目接口")
    @PostMapping("/admin/createExaminationClassify")
    private R<Object> createExaminationClassify(String name){
        ExaminationClassifyDto examinationClassifyDto  = examinationClassifyService.createExaminationClassify(name);
        return R.success(examinationClassifyDto);
    }


    /**
     * 删除考试接口
     * @param id
     * @return
     */
    @ApiOperation(value = "删除考试接口")
    @DeleteMapping("/admin/delete/ExaminationClassify")
    private R deleteExaminationClassify(String id){
        examinationClassifyService.deleteExaminationClassify(id);
        return R.success();
    }



    /**
     * 获取考试下的题接口
     * @param classifyId
     * @return
     */
//    @ApiOperation(value = "获取考试类目下的题接口")
//    @GetMapping("/admin/findExaminationClassify")
//    private R<Object> findExaminationClassify(String classifyId){
//        examinationClassifyService.findExaminationClassify(classifyId);
//        return R.success("");
//    }


}

